import * as React from 'react';
import BaseLayout from './components/base-layout';
import {BrowserRouter} from 'react-router-dom';
import {Switch, Route} from 'react-router';
import Login from './page/login';
import AuthorizedRoute from './components/authorized-route';
import AppStore from './store/appStore'


class App extends React.Component<any> {
    public render() {
        return (
            <BrowserRouter>
                <Switch>
                    <Route
                        key="/user/login"
                        path="/user/login"
                        exact={true}
                        component={Login}
                    />
                    <AuthorizedRoute
                        path="/"
                        redirectPath="/user/login"
                        render={() => {
                            return <BaseLayout appStore={AppStore}/>
                        }}
                    />
                </Switch>
            </BrowserRouter>
        );
    }
}

export default App;
